<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<html>
    <head>
        <link type="text/css" rel="stylesheet" href="./stylesheets/main.css" />
        <link rel="icon" type="image/vnd.microsoft.icon" href="/favicon.ico"/>

        <!-- Librerías de JQuery -->
        <script type="text/javascript" src="jQuery/js/jquery.min.js"></script>
        <script type="text/javascript" src="jQuery/js/jquery-ui.custom.min.js"></script>


        <!-- Librerías del plugin de rating para JQuery-->
        <script type="text/javascript" src="jQuery/js/jquery.ui.stars.js"></script>
        <link rel="stylesheet" type="text/css" href="jQuery/css/crystal-stars.css" />

        <!--Librerías de FancyBox-->
        <script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
        <script type="text/javascript" src="fancybox/jquery.easing-1.3.pack.js"></script>
        <script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
        <link rel="stylesheet" href="fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />


        <script type="text/javascript">

            $(document).ready(
                function (){
                }
            );          
        </script>
    </head>



    <body>

        Te llamas ${usuario.username} (recuperado desde la sesión}
        <c:choose>
            <c:when test="${!empty mensajes}">
                <c:forEach var="mensaje" items="${mensajes}" varStatus="status">
                    
                    
                        <b><fmt:formatDate value="${mensaje.fecha}" pattern="dd/MM/yy hh:mm:ss"/></b>,
                           
                        <c:choose>
                            <c:when test="${empty mensaje.author}">
                                <b>anonymous:</b>,
                            </c:when>
                            <c:otherwise>
                                <b><c:out   value="${mensaje.author}"/></b>,
                            </c:otherwise>
                        </c:choose>
                        <c:out value="${mensaje.content}"/><br/>
                </c:forEach>
            </c:when>
            <c:otherwise>
                <p>El usuario no tiene mensajes.</p>
            </c:otherwise>
        </c:choose>
    </body>

</html>